struct input_iterator_tag{
};
struct output_iterator_tag{
};
struct forward_iterator_tag: public input_iterator_tag, output_iterator_tag{
};
struct bidirectional_iterator_tag: public forwrad_iterator_tag{
};
struct random_access_iterator_tag: public bidirectional_iterator_tag{
};
template <class _Mylist>
class _List_iterator: public _List_const_iterator<_Mylist>{
public:
typedef _List_iterator<_Mylist> _Myiter;
typedef _List_const_iterator<_Myiter> _Mybase;
typedef bidirectional_iterator_tag iterator_category;
};
template <class _Ty, class _Ax=allocator<_Ty>>
class list: public _List_val<_Ty, _Ax>
{
public:
typedef _List_val<_Ty, _Ax> _Mybase;
typedef _List_const_iterator<_Mybase> const_iterator;
typedef _List_iterator<_Mybase> iterator;
};
template <class _Iter>
struct iterator_traits{
typedef typename _Iter::iterator_category iterator_category;
typedef typename _Iter::value_type value_type;
typedef typename _Iter::difference_type difference_type;
typedef difference_type distance_type;
typedef typename _Iter::pointer pointer;
typedef typename _Iter::reference reference;
};
template <class _Ty>
struct iterator_traits<_Ty*>{
typedef random_access_iterator_tag iterator_category;
typedef _Ty value_type;
typedef ptrdiff_t differnecee_type;
typedef ptrdiff_t distance_type;
typedef _Ty* pointer;
typedef _Ty& reference;
};
template <class _InIt, class _Diff>
inline void _Advance(_Init& _Where, _Diff _Off, input_interator_tag){
}
template <class _FI, class _Diff>
inline void _Advance(_FI& Where, _Diff _Off, forward_iterator_tag){
}
template <class _BI, class _Diff>
inline void _Advance(_BI& _Where, _Diff _Off, bidirectional_iterator_tag){
}
template <class _RI, class _Diff>
inline void _Advance(_RI& _Where, _Diff _Off, random_access_iterator_tag){
}